<?php
/**
 * vim: et ts=4 sts=4 sw=4 fdm=marker
 *
 * 用户注册controller 
 *
 * @author	wang Penghai <china_php@hotmail.com>
 * @copyright 2008 5e6d Corporation.
 * @version   $Id: config.php 29 2009-03-10 14:30:18Z wph $
 */
class reg_action extends pf_controller{

	protected $obj_user = null;

	public function __construct()
	{
		parent::__construct();
		$this->obj_user = pf_load::init('user_model_user');
	}

	public function index()
	{

		$this->view('user_view_reg');
	}

	//提交注册
	public function do_reg()
	{
		var_export($_POST);
	}

	//检查用户名是否存在
	public function check_name()
	{
		$name = pf_request::post('name');
		if (false === $this->obj_user->check_name($name))//不存在
		{
			echo 1;
		} else {
			echo 0;
		}
		return;
	}
}